/* 
 * This file is part of CompetitionGenerator.
 * CompetitionGenerator is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * CompetitionGenerator is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with CompetitionGenerator. If not, see <http://www.gnu.org/licenses/>.
 */
package competitiongenerator.entities;

import java.util.UUID;
import java.util.logging.Logger;

/**
 * Competition area class.
 * @author Ashitaka
 * @date 11-abr-2009
 */
public class CompetitionAreaKarate {

    /**
     * Logger of the class CompetitionAreaKarate.
     */
    private static final Logger logger = Logger.getLogger(CompetitionAreaKarate.class.getName());
    /**
     * The panel SUSHIN referee.
     */
    private String refereeSushin;
    /**
     * The panel FUKUSHIN (3 or 5).
     */
    private String[] refereeFukushin;
    /**
     * The panel KANSA.
     */
    private String refereeKansa;
    /**
     * The competition area name.
     */
    private String areaName;
    /**
     * The competition area ID number.
     */
    private final UUID areaID;

    /**
     * Constructor.
     * @param areaName The competition area name.
     * @param refereeSushin The SUSHIN name.
     * @param refereeFukushin The FUKUSIN names.
     * @param refereeKansa The KANSA name.
     */
    public CompetitionAreaKarate(String areaName) {
        this.areaID = UUID.randomUUID();
        this.areaName = areaName;
        this.refereeSushin = null;
        this.refereeFukushin = null;
        this.refereeKansa = null;
    }

    /**
     * Getter.
     * @return The competition area name.
     */
    public String getAreaName() {
        return areaName;
    }

    /**
     * Setter.
     * @param areaName The competition area name.
     */
    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    /**
     * Getter.
     * @return The competition referee names.
     */
    public String[] getRefereeFukushin() {
        return refereeFukushin;
    }

    /**
     * Setter.
     * @param refereeFukushin The competition referee names.
     */
    public void setRefereeFukushin(String[] refereeFukushin) {
        this.refereeFukushin = refereeFukushin;
    }

    /**
     * Getter.
     * @return The KANSA name.
     */
    public String getRefereeKansa() {
        return refereeKansa;
    }

    /**
     * Setter.
     * @param refereeKansa The KANSA name.
     */
    public void setRefereeKansa(String refereeKansa) {
        this.refereeKansa = refereeKansa;
    }

    /**
     * Getter.
     * @return The SUSHIN name.
     */
    public String getRefereeSushin() {
        return refereeSushin;
    }

    /**
     * Setter.
     * @param refereeSushin The SUSHIN name.
     */
    public void setRefereeSushin(String refereeSushin) {
        this.refereeSushin = refereeSushin;
    }

    /**
     * Getter.
     * @return The competition area ID number.
     */
    public UUID getAreaID() {
        return areaID;
    }

    /**
     * The competition area content.
     * @return The competition area fields as String.
     */
    @Override
    public String toString() {

        StringBuffer bs = new StringBuffer();
        bs.append("<-- Tatami -->");
        bs.append("\nID:");
        bs.append(getAreaID());
        bs.append("\nName: ");
        bs.append(getAreaName());
        if (getRefereeSushin() != null) {
            bs.append("\nSushin name: ");
            bs.append(getRefereeSushin());
        }
        if (getRefereeFukushin() != null) {
            bs.append("\nFukishin names: ");
            for (String i : getRefereeFukushin()) {
                bs.append("\n");
                bs.append(i);
            }
        }
        if (getRefereeKansa() != null) {
            bs.append("\nKansa name: ");
            bs.append(getRefereeKansa());
        }

        return bs.toString();
    }
}
